package util;

import java.util.List;

public class Page {
	private int pageIndex;
	private int pageSize = 3;
	
	private int count;

	
	private List<?> list;

	public int getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public int getTotal() {
		return (count-1)/pageSize + 1;
	}
	
	public int getNext(){
		int total =getTotal();
		return pageIndex<total?(pageIndex+1):total;
	}
	
	public int getPrev(){
		return pageIndex>1?(pageIndex-1):pageIndex;
	}


	public List<?> getList() {
		return list;
	}

	public void setList(List<?> list) {
		this.list = list;
	}
	
	
	
}
